package com.kwq.designPattern.construct.Filter;

import java.util.ArrayList;
import java.util.List;

/**
 * @author kangwanqiang
 * @date 2021/2/6
 * @description 以gender=female为标准过滤person
 */
public class CriteriaFemaleImpl implements Criteria {
    @Override
    public List<Person> meetCriteria(List<Person> persons) {

        List<Person> result = new ArrayList<>();
        for (Person person : persons) {
            if (person.getGender().equals(Person.Gender.FEMALE.value)) {
                result.add(person);
            }
        }
        return result;
    }
}
